﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExpenseSystem.Model;
using ExpenseSystem.Lor;
using ExpenseSystem.Common;
using ExpenseSystem.DataUpdater;
using ExpenseSystem.Fether;
using ExpenseSystem.Core.DataAddOn;
using System.Web;

namespace ExpenseSystem.Core.QuoteModules
{
    public class QuoteDetailBaseManager:QuoteDetailManager
    {

        QuoteDetailFetcher fetcher = new QuoteDetailFetcher();
        public override bool Delete(QuoteDetailModel QuoteDetail,out string message)
        {
            if (QuoteDetail.Site != profile.SiteId)
            {
                message = "当前登录的组织与档案所在组织不一致";
                return false;
            }
            bool result = QuoteDetailUpdater.Remove(QuoteDetail, tran, fetcher, out message);
            return result;
        }

        public override bool DeleteById( long[] QuoteDetailIds,  out string message)
        {
            bool result = true;
            result = QuoteDetailUpdater.RemoveById( profile.SiteId, QuoteDetailIds, tran, fetcher, out message);
            return result;
        }

        public override bool Save( QuoteDetailModel QuoteDetail, out string message, params IAddable<QuoteDetailModel>[] addablese)
        {
            if (QuoteDetail.Site != profile.SiteId)
            {
                message = "当前登录的组织与档案所在组织不一致";
                return false;
            }
            bool result = true;
            result = QuoteDetailUpdater.Save( QuoteDetail, tran, fetcher, out message);
            return result;
        }
    }
}
